﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using KPIS.GERP.Models;
using KPIS.GERP.Models.SYS;

namespace KPIS.GERP.WCF.Approval
{
    [ServiceContract]
    public interface ICommanderLine
    {
        [OperationContract]
        IEnumerable<ApprovePath> SelectApprovePath(string processId);
    }

    public class CommanderLine : ICommanderLine
    {
        public IEnumerable<ApprovePath> SelectApprovePath(string processId)
        {
            using(var db = new GERPContext())
            {
                return db.ApprovePaths.Where(o => o.Process == processId);
            }
        }
    }
}
